import React, { useEffect, useState } from "react";
import http from "../../../http";
import styles from "./index.module.scss";
import { Cell, Image } from "react-vant";

export default function () {
  interface Perld {
    age?: number;
    bankFlag?: number;
    email?: Number;
    faceFlag?: number;
    headPic?: string;
    height?: number;
    idCardFlag?: number;
    invitationCode?: string;
    jiGuangPwd?: string;
    nickName?: string;
    sessionId?: number;
    sex?: number;
    userId?: number;
    userName?: string;
    weight?: number;
    whetherBingWeChat?: number;
  }
  const [setper, setsPer] = useState<Perld>({});
  useEffect(() => {
    http.get("health/user/verify/v1/getUserInfoById").then((res: any) => {
      console.log(res);
      setsPer(res.result);
    });
  });
  return (
    <div>
      <div className={styles.sru_headers}>
        <h1>{"<"} </h1>
        <span>个人信息页</span>
      </div>
      <div>
        <Cell title="头像">
          <div className={styles.sets_setimg}>
            <Image width={44} height={44} src={setper.headPic} round />
          </div>
        </Cell>
        <br />
        <Cell title="昵称" isLink value={setper.nickName} />
        <Cell title="性别" isLink value={setper.nickName} />
        <div className={styles.set_cells}>
          <Cell title="体征">
            <div className={styles.hbus_cell}>
              <Cell title="体重" isLink value={setper.height} />
              {setper.height}
            </div>
          </Cell>
        </div>
      </div>
    </div>
  );
}
